<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateTableSubTopic extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('sub_topics', function (Blueprint $table) {
            $table->integer('sub_id')->unsigned()->default(0);  //子话题ID
            $table->integer('tid')->unsigned()->default(0);  //话题ID
            $table->string('title')->default('');  //子话题
            $table->char('type',20)->default('radio'); //选择类型
            $table->primary(['sub_id','tid']);  //联合主键
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('sub_topics');
    }
}
